extends "../cex___toolman/cex___toolman.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "士兵"
	camp = "战士"
	lv = 1
	attCoe.atkRan = 1
	attCoe.atk = 30 / 8.5 * 2
	attCoe.maxHp = 500 / 112.5
	attAdd.spd += 0.4
	atkEff = "atk_dao"
	addSkillTxt("战士联营：每上场一个战士系角色，战士系人物增伤&免伤+3/6%，最多起效5个人物累计值(从高到低累计）")

func _onBattleStart():
	var waitadd = []
	var chas = getAllChas(2)
	var cnt = 0
	var bcnt = 0
	chas.sort_custom(self,"sortbylv")
	for i in chas:
		if i.get("camp") == "战士":
			cnt += 1
			waitadd.append(i)
			if cnt >= 5:continue
			if i.lv == 1:
				bcnt += 3
			else:
				bcnt += 6
	if !cnt:return 
	for i in waitadd:
		i.addBuff(ZXLY.new(bcnt))
	._onBattleStart()

func sortbylv(a,b):
	return a.lv > b.lv

class ZXLY:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		id = "ZXLY"
		life = 1000000
		att.atkR = lv * 0.01
		att.defR = lv * 0.01